package com.iweb.controller;

import com.iweb.common.result.ResultEntity;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ExceptionController {

    @ApiOperation("测试统一异常,接口实现了一个触发运算")
    @GetMapping("exception/{number}")
    public ResultEntity<Integer> exception(@PathVariable Integer number) {
        Integer result = 100 / number;
        // 不需要关系异常的问题,由统一异常接口处理
        return ResultEntity.SUCCESS(result);
    }

}
